using System;
using System.Collections.Generic;
using System.Data.Services.Client;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;

namespace AzureContrib.WindowsAzure.StorageClient
{
	/// <summary>
	/// <see cref="CloudTableClient"/>
	/// </summary>
	public interface ICloudTableClient
	{
		/// <summary>
		/// <see cref="CloudTableClient.MinSupportedDateTime"/>
		/// </summary>
		DateTime MinSupportedDateTime { get; }

		/// <summary>
		/// <see cref="CloudTableClient.BaseUri"/>
		/// </summary>
		Uri BaseUri { get; }
	
		/// <summary>
		/// <see cref="CloudTableClient.RetryPolicy"/>
		/// </summary>
		RetryPolicy RetryPolicy { get; set; }
		
		/// <summary>
		/// <see cref="CloudTableClient.Timeout"/>
		/// </summary>
		TimeSpan Timeout { get; set; }
		
		/// <summary>
		/// <see cref="CloudTableClient.Credentials"/>
		/// </summary>
		StorageCredentials Credentials { get; }
		
		/// <summary>
		/// <see cref="CloudTableClient.CreateTablesFromModel"/>
		/// </summary>
		void CreateTablesFromModel(Type serviceContextType);
		
		/// <summary>
		/// <see cref="CloudTableClient.GetDataServiceContext"/>
		/// </summary>
		TableServiceContext GetDataServiceContext();
		
		/// <summary>
		/// <see cref="CloudTableClient.Attach"/>
		/// </summary>
		void Attach(DataServiceContext serviceContext);
		
		/// <summary>
		/// <see cref="CloudTableClient.BeginCreateTable"/>
		/// </summary>
		IAsyncResult BeginCreateTable(string tableName, AsyncCallback callback, object state);
		
		/// <summary>
		/// <see cref="CloudTableClient.EndCreateTable"/>
		/// </summary>
		void EndCreateTable(IAsyncResult asyncResult);
		
		/// <summary>
		/// <see cref="CloudTableClient.CreateTable"/>
		/// </summary>
		void CreateTable(string tableName);
		
		/// <summary>
		/// <see cref="CloudTableClient.BeginCreateTableIfNotExist"/>
		/// </summary>
		IAsyncResult BeginCreateTableIfNotExist(string tableName, AsyncCallback callback, object state);
		
		/// <summary>
		/// <see cref="CloudTableClient.EndCreateTableIfNotExist"/>
		/// </summary>
		bool EndCreateTableIfNotExist(IAsyncResult asyncResult);
		
		/// <summary>
		/// <see cref="CloudTableClient.CreateTableIfNotExist"/>
		/// </summary>
		bool CreateTableIfNotExist(string tableName);
		
		/// <summary>
		/// <see cref="CloudTableClient.BeginDoesTableExist"/>
		/// </summary>
		IAsyncResult BeginDoesTableExist(string tableName, AsyncCallback callback, object state);
		
		/// <summary>
		/// <see cref="CloudTableClient.EndDoesTableExist"/>
		/// </summary>
		bool EndDoesTableExist(IAsyncResult asyncResult);
		
		/// <summary>
		/// <see cref="CloudTableClient.DoesTableExist"/>
		/// </summary>
		bool DoesTableExist(string tableName);
		
		/// <summary>
		/// <see cref="CloudTableClient.ListTables()"/>
		/// </summary>
		IEnumerable<string> ListTables();
		
		/// <summary>
		/// <see cref="CloudTableClient.ListTables(string)"/>
		/// </summary>
		IEnumerable<string> ListTables(string prefix);
		
		/// <summary>
		/// <see cref="CloudTableClient.ListTablesSegmented()"/>
		/// </summary>
		ResultSegment<string> ListTablesSegmented();
		
		/// <summary>
		/// <see cref="CloudTableClient.ListTablesSegmented(int,ResultContinuation)"/>
		/// </summary>
		ResultSegment<string> ListTablesSegmented(int maxResults, ResultContinuation continuationToken);
		
		/// <summary>
		/// <see cref="CloudTableClient.ListTablesSegmented(string,int,ResultContinuation)"/>
		/// </summary>
		ResultSegment<string> ListTablesSegmented(string prefix, int maxResults, ResultContinuation continuationToken);
		
		/// <summary>
		/// <see cref="CloudTableClient.BeginListTablesSegmented(AsyncCallback,object)"/>
		/// </summary>
		IAsyncResult BeginListTablesSegmented(AsyncCallback callback, object state);
		
		/// <summary>
		/// <see cref="CloudTableClient.BeginListTablesSegmented(string,AsyncCallback,object)"/>
		/// </summary>
		IAsyncResult BeginListTablesSegmented(string prefix, AsyncCallback callback, object state);
		
		/// <summary>
		/// <see cref="CloudTableClient.BeginListTablesSegmented(string,int,ResultContinuation,AsyncCallback,object)"/>
		/// </summary>
		IAsyncResult BeginListTablesSegmented(string prefix, int maxResults, ResultContinuation continuationToken, AsyncCallback callback, object state);
		
		/// <summary>
		/// <see cref="CloudTableClient.EndListTablesSegmented"/>
		/// </summary>
		ResultSegment<string> EndListTablesSegmented(IAsyncResult asyncResult);
		
		/// <summary>
		/// <see cref="CloudTableClient.BeginDeleteTable"/>
		/// </summary>
		IAsyncResult BeginDeleteTable(string tableName, AsyncCallback callback, object state);
		
		/// <summary>
		/// <see cref="CloudTableClient.EndDeleteTable"/>
		/// </summary>
		void EndDeleteTable(IAsyncResult asyncResult);
		
		/// <summary>
		/// <see cref="CloudTableClient.DeleteTable"/>
		/// </summary>
		void DeleteTable(string tableName);
		
		/// <summary>
		/// <see cref="CloudTableClient.BeginDeleteTableIfExist"/>
		/// </summary>
		IAsyncResult BeginDeleteTableIfExist(string tableName, AsyncCallback callback, object state);
		
		/// <summary>
		/// <see cref="CloudTableClient.EndDeleteTableIfExist"/>
		/// </summary>
		bool EndDeleteTableIfExist(IAsyncResult asyncResult);
		
		/// <summary>
		/// <see cref="CloudTableClient.DeleteTableIfExist"/>
		/// </summary>
		bool DeleteTableIfExist(string tableName);
	}
}